<div class="layui-card">
  <div class="layui-card-body">
      <div class="layui-row">
          <table class="layui-hide" lay-filter="table" id="table"></table>
      </div>
  </div>
</div>

<script>
layui.use(['table','form','larry'], function(){
    var form = layui.form;
    var table = layui.table;
    var $ = layui.$;
    var larry = layui.larry;
    form.render('select');
    search = function(){
        var url = "/goodsagent/lists";
        var data = $("#form").find("[name]");
        table.render({
            elem: '#table'
            ,url:url
            ,where:{"shop_id":<?=$shop_id;?>}
            ,method:'post'
            ,page: true
            ,cols: [[
                { field: 'id', title: 'ID', width: 80, sort: true, title: 'ID' },
                {field:'pic', title: '图片', width: 60,templet: function(d){
                    return "<img height=30 src='"+d.pic+"' />";
                }},
                { field: 'title', title: '标题' },
                { field: 'ptitle', title: '分类' },
                { field: 'changjia_info', title: '厂家信息' },
                { field: 'price', title: '价格' },
                { field: 'point', title: '可抵扣积分' },
                { field: 'point', title: '可抵扣积分' },
                { field: 'fanyong', title: '返佣' },
                { field: 'status', width: 60, title: '状态' },
            ]]
        });
    };
    search();
      //监听工具条
      table.on('tool(table)', function(obj){
            var data = obj.data;

      });
});
</script>
